#pragma once

#include "IGameScreen.h"
#include "Iw2D.h"
#include "Sprite.h"
#include "FVec2RingBuffer.h"
#include "Ship.h"
#include "Dock.h"
#include "Water.h"
#include "GameplayBackground.h"
#include "GameplayUI.h"
#include "PauseMenu.h"
#include "GameOverMenu.h"

// the maximum numbre of ships which can be on the screen at the same time
#define MAX_NUM_SHIPS 10
#define MAX_NUM_DOCKS 2

class ScoreSystem;
class ILevel;

namespace GameplayState {
	enum Enum {
		NORMAL,
		PAUSED, 
		GAME_OVER,
		LEVEL_COMPLETE,
	};
}

class MainGameplayScreen : public IGameScreen {

public:
	MainGameplayScreen( ScoreSystem* score_system );

	virtual void Load();
	virtual void Unload();
		
	// returns the id of the screen it should be switched to
	// -1 if the screen shouldn't be switcher
	virtual int Update( float dt );
	virtual void Render();
	
private:

	// contains the id of the ship which path gets currently 
	// drawn by the player
	// -1 if no ship is selected
	int m_active_ship;
	
	int m_current_score;
	
	float m_level_complete_state;

	Ship m_ships[MAX_NUM_SHIPS];
	Dock m_docks[MAX_NUM_DOCKS];

	Water m_water;
	GameplayBackground m_background;
	
	GameplayUI m_gameplay_ui;
	PauseMenu m_pause_menu;
	GameOverMenu m_gameover_menu;
	
	ScoreSystem *m_score_system;
	GameplayState::Enum m_state;
	
	Sprite m_level_complete;
	
	// the current level wich is resposible for setting up the level
	ILevel *m_current_level;
};